#include <iostream>
#include <GL/freeglut.h>

using namespace std;

int window_width = 1024;
int window_height = 768;

void DisplayFunc()
{
	cout << "DisplayFunc() called." << endl;
}

void ReshapeFunc(int w, int h)
{ 
	cout << "ReshapeFunc() called." << endl;
}

void KeyboardFunc(unsigned char c, int x, int y)
{
	cout << "KeyboardFunc() called." << endl;
	switch (c)
	{
	case 'x':
	case 27:
		glutLeaveMainLoop();
		return;
	}
}

int main(int argc, char * argv[])
{
	glutInit(&argc, argv);
	glutInitWindowPosition(0, 0);
	glutInitWindowSize(window_width, window_height);
	glutInitDisplayMode(GLUT_RGBA);
	glutDisplayFunc(DisplayFunc);
	glutReshapeFunc(ReshapeFunc);
	glutKeyboardFunc(KeyboardFunc);

	glutMainLoop();

	return 0;
}
